home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / Catalog Service Access Module / DTS Sample CSAM / Src / DTSSampleCSAMTemplate.r < prev    next >
Encoding:
Text File  |  1993-11-02  |  8.0 KB  |  396 lines  |  [TEXT/KAHL]

  1. /*
  2.  * DTSSampleCSAMTemplate.r
  3.  * Copyright © 1992-93 Apple Computer Inc. All Rights Reserved.
  4.  *
  5.  * This file contains the template-specific resources for the
  6.  * DTS Sample CSAM. It is included by DTSSampleCSAM.r
  7.  */
  8. #include "OCETemplates.h"
  9.  
  10. /*
  11.  * These three strings must be unique throughout the AOCE environment.
  12.  * By convention, the creator id is appended to a defined string.
  13.  */
  14. #define kServiceRecordType                kDirectoryRecTypeBody kCSAMCreatorIDString
  15. #define kAspectName                        "Aspect " kCSAMCreatorIDString 
  16.  
  17. /*
  18.  * Resource file definitions
  19.  */
  20. #if Think_Rez == 0
  21. #define kTemplateCodeFile                "::Obj:DTSSampleTemplate.code"
  22. #define kIconResourceFile                "::DTSSampleIcons"
  23. #else
  24. #define kIconResourceFile                "DTSSampleIcons"
  25. #endif
  26. /*
  27.  * These are the resource id's of the "original" icons in kIconResourceFile.
  28.  * They will be included using AOCE-specific resource id numbers.
  29.  */
  30. #define kIconID                            129                /* In Icon file            */
  31.  
  32. /*
  33.  * The CSAM's name is used to name the CSAM's record.
  34.  */
  35. resource 'STR ' (
  36.             kCSAMName,
  37.             kTemplateName " Name",
  38.             purgeable ) {
  39.     kTemplateName " Catalog"                /* "DTS Sample Catalog"                */
  40. };
  41.  
  42. /*
  43.  * SAM Property default values. This tells OCE that we
  44.  * only serve a CSAM, and that we are always active.
  45.  */
  46. resource 'sami' (
  47.             kCSAMAspect + kSAMAspectSlotCreationInfo,
  48.             kTemplateName " SAM Slot Creation Info",
  49.             purgeable
  50.         ) {
  51.     0,                    /* Any number of directories    */
  52.     kCSAMCreatorID,        /* My registered creator id        */
  53.     notMSAM,            /* Doesn't serve an MSAM        */
  54.     servesDSAM,            /* Serves a CSAM                */
  55.     "Sample Personal Catalog",
  56.     "Untitled Personal Catalog"
  57. };
  58.  
  59. /*
  60.  * Sample Directory CSAM Aspect
  61.  */
  62. resource 'deta' (
  63.             kCSAMAspect,
  64.             kTemplateName " Aspect",
  65.             purgeable
  66.         ) {    
  67.     0, dropCheckConflicts, isMainAspect /* , enabled -- Not in 1.0A14 build        */
  68. };
  69.  
  70. resource 'rstr' (
  71.             kCSAMAspect + kDETTemplateName,
  72.             kTemplateName " Aspect Name",
  73.             purgeable
  74.         ) {
  75.     kAspectName                    /* Unique throughout system                        */
  76. };
  77.  
  78. resource 'rstr' (
  79.             kCSAMAspect + kDETRecordType,
  80.             kTemplateName " Record Type",
  81.             purgeable
  82.         ) {
  83.     kServiceRecordType            /* Unique throughout system                        */
  84. };
  85.  
  86. resource 'rstr' (
  87.             kCSAMAspect + kDETAspectKind,
  88.             kTemplateName " Kind",
  89.             purgeable
  90.         ) {
  91.     kTemplateName "Sample Personal Catalog"
  92. };
  93.  
  94. resource 'rstr' (
  95.             kCSAMAspect + kSAMAspectKind,
  96.             kTemplateName " Kind",
  97.             purgeable
  98.         ) {
  99.     kTemplateName "Sample Personal Catalog"
  100. };
  101.  
  102. resource 'rstr' (
  103.             kCSAMAspect + kDETAspectName,
  104.             kTemplateName " Name",
  105.             purgeable
  106.         ) {
  107.     "Untitled Personal Catalog"
  108. };
  109.  
  110. resource 'rstr' (
  111.             kCSAMAspect + kSAMAspectUserName,
  112.             kTemplateName " Name",
  113.             purgeable
  114.         ) {
  115.     "CSAM User"
  116. };
  117.  
  118. #if Think_Rez == 0
  119. /*
  120.  * The template is managed by a code segment. This is the
  121.  * result of compiling DTS_CSAMTemplate.c and DETUtilities.c
  122.  * (see the Makefile for details). This is used only by MPW.
  123.  */
  124. include kTemplateCodeFile 'detc'(0) as 'detc' (
  125.             kCSAMAspect + kDETAspectCode,
  126.             kTemplateName,
  127.             purgeable
  128.         );
  129. #endif
  130.  
  131. /*
  132.  * This is a balloon help string.
  133.  */
  134. resource 'rstr' (
  135.             kCSAMAspect + kDETAspectWhatIs,
  136.             kTemplateName " WhatIs",
  137.             purgeable
  138.         ) {
  139.     "Open this Sample Personal Catalog to see which"
  140.     " Personal Catalog it is bound to."
  141. };
  142.  
  143. /*
  144.  * Here are more balloons.
  145.  */
  146. resource 'rst#' (
  147.             kCSAMAspect + kDETAspectBalloons,
  148.             kTemplateName " Balloons",
  149.             purgeable
  150.         ) {
  151.     {
  152.         "Click this to set whether or not the catalog is active.",
  153.         "ERROR",
  154.         "Press this button to create a Personal Catalog that"
  155.             " will be bound to this Sample Catalog.",
  156.         "ERROR"
  157.     }
  158. };
  159.  
  160. resource 'dett' (
  161.             kCSAMAspect + kDETAspectLookup,
  162.             kTemplateName " Lookup Table",
  163.             purgeable
  164.         ) {
  165.     {
  166.         { kPDAliasAttrTypeBody },
  167.         typeBinary,
  168.         useForInput,
  169.         useForOutput,
  170.         notInSublist,
  171.         isNotAlias,
  172.         isNotRecordRef,
  173.         {
  174.             'p:=p',        prHasCatalog,        kDETOneProperty;
  175.             'btyp',        kDETNoProperty,     1;
  176.             'rest',        prPDAlias,            0 
  177.         }
  178.     }
  179. };
  180.  
  181. /*
  182.  * Aspect icons
  183.  */
  184. include kIconResourceFile 'ICN#' (kIconID) as 'ICN#' (
  185.             kCSAMAspect + kDETAspectMainBitmap,
  186.             kTemplateName,
  187.             purgeable
  188.         );
  189. include kIconResourceFile 'ics#' (kIconID) as 'ics#' (
  190.             kCSAMAspect + kDETAspectMainBitmap,
  191.             kTemplateName,
  192.             purgeable
  193.         );
  194. include kIconResourceFile 'SICN' (kIconID) as 'SICN' (
  195.             kCSAMAspect + kDETAspectMainBitmap,
  196.             kTemplateName,
  197.             purgeable
  198.         );
  199. include kIconResourceFile 'icl8' (kIconID) as 'icl8' (
  200.             kCSAMAspect + kDETAspectMainBitmap,
  201.             kTemplateName,
  202.             purgeable
  203.         );
  204. include kIconResourceFile 'ics8' (kIconID) as 'ics8' (
  205.             kCSAMAspect + kDETAspectMainBitmap,
  206.             kTemplateName,
  207.             purgeable
  208.         );
  209. include kIconResourceFile 'icl4' (kIconID) as 'icl4' (
  210.             kCSAMAspect + kDETAspectMainBitmap,
  211.             kTemplateName,
  212.             purgeable
  213.         );
  214. include kIconResourceFile 'ics4' (kIconID) as 'ics4' (
  215.             kCSAMAspect + kDETAspectMainBitmap,
  216.             kTemplateName,
  217.             purgeable
  218.         );
  219.  
  220. /*
  221.  * Organize the appearance of the
  222.  * Personal Directory CSAM Info Page
  223.  */
  224. #define kBorderRect             {            \
  225.         45,                                    \
  226.         0,                                    \
  227.         46,                                    \
  228.         kDETRecordInfoWindWidth                \
  229.     }
  230. #define kPDMessageRect            {            \
  231.         56,                                    \
  232.         12,                                    \
  233.         56 + (2 * kDETAppFontLineHeight),    \
  234.         kDETRecordInfoWindWidth - 12        \
  235.     }
  236. #define kSetPDButtonRect         {            \
  237.         56 + (3 * kDETAppFontLineHeight),    \
  238.         130,                                \
  239.         76 + (3 * kDETAppFontLineHeight),    \
  240.         275                                    \
  241.     }
  242. #define kPDRect                    {            \
  243.         56 + (2 * kDETAppFontLineHeight),    \
  244.         12,                                    \
  245.         56 + (4 * kDETAppFontLineHeight),    \
  246.         kDETRecordInfoWindWidth - 12        \
  247.     }
  248. #define kActiveButtonRect        {            \
  249.         56 + (5 * kDETAppFontLineHeight),    \
  250.         30,                                    \
  251.         76 + (5 * kDETAppFontLineHeight),    \
  252.         100                                    \
  253.     }
  254.  
  255. resource 'deti' (
  256.             kCSAMInfoPage,
  257.             kTemplateName,
  258.             purgeable
  259.         ) {
  260.     1000,                /* Sort order magic constant    */
  261.     {0, 0, 0, 0},
  262.     noSelectFirstText,
  263.     { 
  264.         kDETNoProperty,    kDETNoProperty,        kCSAMInfoPage; 
  265.         prHasCatalog,    kDETZeroProperty,    kCSAMInfoPage + 1; 
  266.         prHasCatalog,    kDETOneProperty,    kCSAMInfoPage + 2; 
  267.     },
  268.     { 
  269.     }
  270. };
  271.  
  272. resource 'rstr' (
  273.             kCSAMInfoPage + kDETTemplateName,
  274.             kTemplateName " Info Page Name",
  275.             purgeable
  276.         ) {
  277.     kTemplateName " Info Page"
  278. };
  279.  
  280.  
  281. resource 'rstr' (
  282.             kCSAMInfoPage + kDETRecordType,
  283.             kTemplateName " Info Page Record Type",
  284.             purgeable
  285.         ) {
  286.     kServiceRecordType                    /* Unique throughout system                */
  287. };
  288.  
  289. resource 'rstr' (
  290.             kCSAMInfoPage + kDETInfoPageName,
  291.             kTemplateName " Info Page Name",
  292.             purgeable
  293.         ) {
  294.     /*
  295.      * Readable text
  296.      */
  297.     kTemplateName
  298. };
  299.  
  300. resource 'rstr' (
  301.             kCSAMInfoPage + kDETInfoPageMainViewAspect,
  302.             kTemplateName " Info Page Main View Aspect",
  303.             purgeable
  304.         ) {
  305.     kAspectName                            /* Unique throughout system                */
  306. };
  307.  
  308. resource 'detv' (
  309.             kCSAMInfoPage,
  310.             kTemplateName " Common",
  311.             purgeable
  312.         ) {
  313.     {
  314.         kDETSubpageIconRect,
  315.             kDETNoFlags,
  316.             kDETAspectMainBitmap,
  317.             Bitmap { kDETLargeIcon };
  318.         kBorderRect,
  319.             kDETNoFlags,
  320.             kDETNoProperty,
  321.             Box { kDETBoxIsGrayed };
  322.     }
  323. };
  324.  
  325. resource 'detv' (
  326.             kCSAMInfoPage + 1,
  327.             kTemplateName " Unconfigured",
  328.             purgeable
  329.         ) {
  330.     {
  331.         kPDMessageRect,
  332.             kDETNoFlags,
  333.             kDETNoProperty,
  334.             StaticTextFromView {
  335.                 kDETApplicationFont,
  336.                 kDETApplicationFontSize,
  337.                 kDETCenter,
  338.                 kDETBold, 
  339.                 "This catalog is not bound to a Personal Catalog."
  340.             };
  341.         kSetPDButtonRect,
  342.             kDETNoFlags,
  343.             prCreatePDButton,
  344.             Button {
  345.                 kDETSystemFont,
  346.                 kDETSystemFontSize,
  347.                 kDETCenter,
  348.                 kDETNormal,
  349.                 "Create Catalog",
  350.                 prCreatePDButton
  351.             };
  352.     }
  353. };
  354.  
  355. resource 'detv' (
  356.             kCSAMInfoPage + 2,
  357.             kTemplateName " Configured",
  358.             purgeable
  359.         ) {
  360.     {
  361.         kPDMessageRect,
  362.             kDETNoFlags,
  363.             kDETNoProperty,
  364.             StaticTextFromView {
  365.                 kDETApplicationFont,
  366.                 kDETApplicationFontSize,
  367.                 kDETCenter,
  368.                 kDETBold, 
  369.                 "This catalog is bound to the"
  370.                 " following Personal Catalog:"
  371.             };
  372.         kPDRect,
  373.             kDETNoFlags + kDETMultiLine,
  374.             prPDAlias,
  375.             StaticText {
  376.                 kDETApplicationFont,
  377.                 kDETApplicationFontSize,
  378.                 kDETCenter,
  379.                 kDETNormal
  380.             };
  381.     }
  382. };
  383.  
  384. /*
  385.  * Template prompt strings
  386.  */
  387. resource 'STR#' (
  388.             kCSAMPromptStrings,
  389.             kTemplateName " Standard File Prompt Strings",
  390.             purgeable
  391.         ) {
  392.     {    
  393.         "Create the Personal Catalog as",    /* kNewPDPrompt    */
  394.         "Personal Catalog"                    /* kNewPDName    */
  395.     }
  396. };